<template>
  <div class="DetailsPage">
    <div class="header">
      <p @click="$router.back(-1)"><van-icon name="arrow-left" /></p>
      <p>订单详情</p>
      <p><van-icon name="ellipsis" /></p>
    </div>
    <div class="express">
      <div class="mailing">
        <p class="icon"><van-icon name="logistics" /></p>
        <div class="address">
          <p>快件离开成都市已发忘达州市</p>
          <p>2020-03-10 16:09:05</p>
        </div>
        <p class="arrow"><van-icon name="arrow" /></p>
      </div>
      <div class="mailing">
        <p class="icon location"><van-icon name="location-o" /></p>
        <div class="consignee">
          <p>{{ msg.title}}</p>
          <p>{{ msg.add_name }}</p>
          <p>电话:{{ msg.tel }}</p>
        </div>
      </div>
    </div>
    <div class="conte">
      <div class="title">
        <van-icon name="birthday-cake-o" />
        <p>XinYi甜品官方店</p>
        <van-icon name="arrow" class="icon" />
      </div>
      <div class="details">
        <div class="list" v-for="data in arr" :key="data.id">
          <div class="img">
            <img src="../assets/stra.png" />
          </div>
          <div class="specs">
            <ul>
              <li>
                <van-icon name="bag" /><span>{{ data.goods_name }}</span>
              </li>
              <li>
                <van-icon name="wap-nav" /><span>{{ data.s_size }}</span>
              </li>
              <li>
                <van-icon name="friends" />
                <span v-if="data.size_id == 3">适合1-2人分享</span>
                <span v-else-if="data.size_id == 2">适合3-4人分享</span>
                <span v-else-if="data.size_id == 4">适合5-6人分享</span>
                <span v-else>适合7-8人分享</span>
              </li>
              <li>
                <van-icon name="gold-coin" /><span
                  >￥{{ data.size_money }}</span
                >
              </li>
            </ul>
          </div>
          <div class="return">
            <button :data-id="data.goods_id">退换</button>
            <ul>
              <li>运费险</li>
              <li>退换货科自动理赔</li>
              <li>{{ data.status_name }}<van-icon name="arrow" /></li>
            </ul>
          </div>
        </div>
        <div class="Price">
          <ul>
            <li>
              <p>商品总价</p>
              <P>￥{{msg.order_money }}</P>
            </li>
            <li>
              <p>运费费用</p>
              <P>￥00.00</P>
            </li>
            <li class="total">
              <p>订单总价</p>
              <P>￥{{msg.order_money }}</P>
            </li>
            <li class="Actual">
              <p>实付款</p>
              <P>￥{{ msg.order_money }}</P>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import "vant/lib/index.css";
import Vue from "vue";
import { Icon } from "vant";
Vue.use(Icon);
export default {
  name: "DetailsPage",
  data() {
    return {
      arr: [],
      msg:[]
    };
  },
  mounted() {
    this.axios
      .get("/api/OrderDetails", {
        params: {
          order_id:this.$route.params.id
        }
      })
      .then(req => {
        this.arr = req.data.data;
        this.msg=this.arr[0]
      })
      .catch(function(error) {
        console.log(error);
      });
  }
};
</script>
<style lang="less" scoped>
* {
  margin: 0;
  padding: 0;
  list-style: none;
  outline: none;
}
@baseFontSize: 20px;
@baseSize: 20;
@color: #ff5000;
html,
body {
  font-size: @baseFontSize;
  height: 100%;
}
.px2rem(@name,@px) {
  @{name}: @px / 2 / @baseSize * 1rem;
}
.DetailsPage {
  min-height: 64.55rem /* 1291/20 */;
  background-color: #fefcfd;
  .header {
    height: 5.2rem /* 104/20 */;
    background: #414141;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    padding: 0 1.2rem;
    font-size: 1.6rem /* 40/20 */;
  }
  .express {
    .mailing {
      border-top: 1px solid #ededed;
      height: 10.15rem /* 203/20 */;
      // .px2rem(height, 203);
      background: rgb(255, 255, 255);
      display: flex;
      align-items: center;
      .icon {
        margin-left: 2rem;
        margin-right: 1rem;
        height: 4rem /* 76/20 */;
        width: 4rem /* 76/20 */;
        background: #3799de;
        font-size: 1.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
        color: rgb(255, 255, 255);
        border-radius: 50%;
      }
      .location {
        background: #ff5a07;
      }
      .consignee {
        font-size: 1.3rem;
        color: #2b2b2b;
        padding-right: 3rem;
        p {
          margin-bottom: 0.5rem;
        }
      }
      .address {
        font-size: 1.4rem;
        color: #3799de;
        width: 17rem;
        :nth-child(2) {
          font-size: 1.2rem;
          color: #9b9b9b;
        }
      }
      .arrow {
        color: #9b9b9b;
        margin-left: 11rem;
        font-size: 2rem;
      }
    }
  }
  .conte {
    margin-top: 1rem;
    background: #ffffff;
    overflow: hidden;
    padding-left: 1.5rem;
    margin-bottom: 5rem;
    padding-bottom: 2rem;
    .title {
      margin-top: 1.2rem;
      display: flex;
      align-items: center;
      font-size: 1.3rem /* 36/20 */;
      color: #2b2b2b;
      p {
        margin-left: 0.5rem;
        margin-right: 0.6rem;
      }
      .icon {
        margin-top: 0.2rem;
        color: #cdcdcd;
      }
    }
    .details {
      .list {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        .img {
          height: 14rem /* 300/20 */;
          margin-left: 1rem;
          img {
            height: 100%;
          }
        }
        .specs {
          margin-left: 5rem;
          ul {
            display: flex;
            flex-direction: column;
            li {
              display: flex;
              align-items: center;
              margin-top: 0.4rem;
              font-size: 1.3rem /* 30/20 */;
              color: #838383;
              margin-bottom: 0.3rem;
              span {
                display: inline-block;
                margin-left: 0.3rem;
              }
            }
          }
        }
        .return {
          button {
            margin-left: 26.5rem;
            background: none;
            border: 1px solid #b1b1b1;
            color: #6f6f6f;
            font-size: 1.25rem /* 26/20 */;
            padding: 0.5rem 2rem;
            border-radius: 2rem;
          }
          ul {
            margin-top: 0.5rem;
            display: flex;
            font-size: 1.3rem /* 28/20 */;
            overflow: hidden;
            :nth-child(1) {
              color: #00111f;
            }
            :nth-child(2) {
              color: #a6a6a6;
              margin-left: 1rem;
            }
            :nth-child(3) {
              color: #ff5501;
              margin-left: 5rem;
              overflow: hidden;
              display: flex;
              align-items: center;
              i {
                margin-left: 0.1rem;
                color: #cacaca;
              }
            }
          }
        }
      }
      .Price {
        margin-top: 0.5rem;
        ul {
          li {
            display: flex;
            align-items: center;
            color: #ababab;
            margin-top: 0.7rem;
            font-size: 1.3rem /* 30/20 */;
            :nth-child(2) {
              margin-left: 19.5rem;
            }
          }
          .total {
            font-size: 1.4rem /* 36/20 */;
            color: #414141;
            :nth-child(2) {
              margin-left: 19.5rem;
            }
          }
          .Actual {
            margin-top: 1.4rem;
            padding-top: 1rem;
            border-top: 1px solid #e4e4e4;
            font-size: 1.5rem /* 36/20 */;
            color:#414141;
            :nth-child(2) {
              margin-left: 20rem;
              color: #414141;
            }
          }
        }
      }
    }
  }
  .footer {
    display: flex;
    height: 5.8rem /* 116/20 */;
    // .px2rem(height, 116);
    background: #ffffff;
    width: 100%;
    z-index: 999;
    align-items: center;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    ul {
      display: flex;
      margin-top: 0.7rem;
      margin-bottom: 0.5rem;
      li {
        margin-right: 0.7rem;
        button {
          background: none;
          outline: none;
          border: 1px solid #dcdcdc;
          font-size: 0.6rem;
          padding: 0.3rem 0.8rem;
          border-radius: 1.2rem;
          color: #777777;
        }
        .over {
          color: @color;
          border: 1px solid @color;
        }
      }
    }
  }
}
</style>
